package com.gilight.base.dao;

import com.gilight.base.model.SysUser;
import com.gilight.base.model.SysUserDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface SysUserMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

    SysUser selectByUserCode(String userCode);

    List<SysUserDTO> findList(Map<String, Object> map);

    void delUserRoleByUserId(Long userId);

    void insertBatchUserRole(@Param("userId") Long userId, @Param("roleIdList") List<Long> roleIdList);

    Map<String,Object> selectStudentByExamineeNumber(String examineeNumber);

    /**
     * 更新用户角色
     *
     * @param mapParam
     * @return
     */
    int updateUserRole(Map<String, Object> mapParam);

    /**
     * 更新用户角色   原先本部门的领导角色更新为普通
     *
     * @param mapParam
     * @return
     */
    int updateManagerUserRole(Map<String, Object> mapParam);

    Map<String, Object> getPropsAsJzg(@Param("userCode") String userCode);

    Map<String, Object> getPropsAsStu(@Param("userCode") String userCode);
}